package warbots.entities.artifacts;


import java.awt.Point;

import warbots.entities.units.Unit;
import warbots.gameplay.Map;


/**
 * @author Ido Adler.
 */
public abstract class Artifact
{
    protected String _name;
    protected int _duration;
    protected boolean _instant;
    protected Unit _parent;
    
    /**
     * TODO: description
     * 
     * @param user
     * @param name
     * @param duration
     * @param instant
     */
    public Artifact(final Unit user, final String name, final int duration,
        final boolean instant)
    {
        super();
        _parent = user;
        _name = name;
        _duration = duration;
        _instant = instant;
    }
    
    public abstract void execute(final Map world, final Point target);
    
    /**
     * @return the duration
     */
    public int getDuration()
    {
        return _duration;
    }
    
    /**
     * @param duration
     *            the duration to set
     */
    public void setDuration(final int duration)
    {
        _duration = duration;
    }
    
    /**
     * @return the instant
     */
    public boolean isInstant()
    {
        return _instant;
    }
    
    /**
     * @param instant
     *            the instant to set
     */
    public void setInstant(final boolean instant)
    {
        _instant = instant;
    }
    
    /**
     * @return the name
     */
    public String getName()
    {
        return _name;
    }
    
    /**
     * @param name
     *            the name to set
     */
    public void setName(final String name)
    {
        _name = name;
    }
    
}
